package com.hshx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hshx.client.UsersClient;
import com.hshx.dao.GrantDao;
import com.hshx.dao.SalaryDao;
import com.hshx.pojo.Grant;
import com.hshx.pojo.Salary;
import com.hshx.pojo.Users;
import com.hshx.service.SalaryService;
import com.hshx.util.RedisUtil1;
import com.hshx.vo.SalaryVo;
import org.apache.ibatis.plugin.Invocation;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Transactional
@Service
public class SalaryServiceImpl extends ServiceImpl<SalaryDao,Salary> implements SalaryService {

    @Resource
    private SalaryDao salaryDao;

    @Override
    public int addStandardCriteria(Salary salary) {
        return salaryDao.addStandardCriteria(salary);
    }

    @Override
    public int deleteStandardCriteria(Integer salary_id) {
        return salaryDao.deleteStandardCriteria(salary_id);
    }

    @Override
    public int deleteStandardCriteriaList(List<String> salary_id_list) {
        return salaryDao.deleteStandardCriteriaList(salary_id_list);
    }

    @Override
    public List<Salary> queryStandardCriteria() {
        return salaryDao.queryStandardCriteria();
    }

    @Override
    public Salary querySalaryID(Integer salary_id) {
        return salaryDao.querySalaryID(salary_id);
    }

    @Override
    public List<Salary> querySalaryNo(String salary_no) {
        return salaryDao.querySalaryNo(salary_no);
    }

    @Override
    public List<Salary> querySalaryName(String salary_name) {
        return salaryDao.querySalaryName(salary_name);
    }

    @Override
    public Page<Salary> findCompensationCriteriaSearch(int pageIndex, int pageSize, String salary_date, String salary_no, String salary_name) {
        Page<Salary> page = PageHelper.startPage(pageIndex,pageSize);
        salaryDao.findCompensationCriteriaSearch(salary_date, salary_no, salary_name);
        return page;
    }

    @Override
    public Page<Salary> findPagination(int pageIndex, int pageSize) {
        Page<Salary> page = PageHelper.startPage(pageIndex,pageSize);
        salaryDao.queryStandardCriteria();
        return page;
    }

    @Override
    public int updateStandardCriteria(Salary salary) {
        return salaryDao.updateStandardCriteria(salary);
    }

    @Override
    public int updateSalaryState(Integer salary_id, Integer salary_state) {
        return salaryDao.updateSalaryState(salary_id, salary_state);
    }

    @Override
    public List<Integer> standardAnalyse1(String date) {
        return salaryDao.standardAnalyse1(date);
    }

}
